# -*- coding: utf-8 -*-


# import pymysql
# 
# connection = pymysql.connect(host='localhost', user='root', passwd='', db='gacsach', charset='utf8')
# cursor = connection.cursor()
#  
# row = cursor.execute("SELECT COUNT(`id`) AS `total` FROM `gacsach` WHERE `id`=%s", "0205e70867310d4a8828ba476f44ebd7")
# print cursor.fetchrow()

# 
# import py_compile
# # py_compile.compile('convertdatabase.py')
# 
# print len('''
# </body></html>''')

import glob
import re

path = "C:\\Users\\LONG HOANG GIANG\\Downloads\\APK\\vn.weplay.batchu-disasm\\assets\\rdata\\rdata0.dat"

numbers = re.compile(r'(\d+)')
def numericalSort(value):
    parts = numbers.split(value)
    parts[1::2] = map(int, parts[1::2])
    return parts

# 
# data = sorted(glob.glob(path), key=numericalSort) 
# 
# of = open("E:/tt", 'wb')
# for filepath in data:
#     print filepath
#     t = open(filepath, 'rb')
#     of.write(t.read())
#     t.close()
#     
#     
# of.flush()
# of.close()
    
fp = open(path, 'rb')
a = fp.read()
b = a.replace(chr(0x00), '')
d = open("E:/g", 'wb')
d.write(b)
d.flush()
d.close()
fp.close()


    

    